package com.epam.Fish;

public class Catfish extends Fish {

    public Catfish(String name, int size, double price, int numberOfMustaches) {
        super(name, size, price);

        this.numberOfMustaches = numberOfMustaches;
    }

    private int numberOfMustaches;

    public int getNumberOfMustaches() {
        return numberOfMustaches;
    }

    public void setNumberOfMustaches(int numberOfMustaches) {

        if(numberOfMustaches > 0){
            this.numberOfMustaches = numberOfMustaches;
        }
    }

    @Override
    public void eat() {
        System.out.println("Catfish eating");
        hunger--;
        System.out.println("Hunger: " + hunger);
    }

    @Override
    public void swim() {
        System.out.println("Catfish swimming");
        hunger++;
        System.out.println("Hunger: " + hunger);
    }

    @Override
    public String toString() {
        return "Catfish [ Name: "+getName()+"; Price: "+getPrice()+"; Size:"+ getSize()+"; Number of mustaches: "+
                getNumberOfMustaches()+"]";
    }


}
